﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="2001.aspx.cs" Inherits="_20_2001" %>

<%@ Register Assembly="MattBerseth.WebControls" Namespace="MattBerseth.WebControls"
    TagPrefix="cc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript">
        function update(msg) {
            __doPostBack('<%=UpdatePanel1.ClientID%>', '');
            tb_remove();
            alert(msg);
        }

        function pageLoad(sender, args) {
            if (args.get_isPartialLoad()) {
                //  reapply the thick box stuff
                tb_init('a.thickbox, input.thickbox,');
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectCountMethod="Get_message_AllData_Count" SelectMethod="Get_message_AllData"
        TypeName="CCH.DAO.messageDAO" EnablePaging="True">
        <SelectParameters>
            <asp:QueryStringParameter Name="sfu_no" QueryStringField="type" Type="Int32" />
            <asp:ControlParameter ControlID="DropDownList1" Name="cla_no" PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="Get_classification_AllData" TypeName="CCH.DAO.classificationDAO">
        <SelectParameters>
            <asp:QueryStringParameter Name="cla_sfuno" QueryStringField="type" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="DivButton">
                <input type="button" value="新增資料" class="thickbox new" alt='<%=Get_url_new() %>'>
            </div>
            <div style='margin: 0 29px'>
                <asp:Label ID="Label5" runat="server" Text="類別："></asp:Label>
                <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="ObjectDataSource2"
                    DataTextField="cla_name" DataValueField="cla_no" AppendDataBoundItems="True">
                </asp:DropDownList>
            </div>
            <div class="datatable">
                <cc1:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" AutoGenerateColumns="False"
                    AllowPaging="True" EmptyDataText="目前無資料" DataKeyNames="mes_no" OnRowCommand="GridView1_RowCommand">
                    <Columns>
                        <asp:TemplateField HeaderText="類別">
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Get_classificationName(Eval("cla_no")) %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="10%" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="標　題">
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# Eval("mes_title") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="發佈時間">
                            <ItemTemplate>
                                <asp:Label ID="Label3" runat="server" Text='<%# Get_DateTime(Eval("mes_datetime")) %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="10%" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="修建者">
                            <ItemTemplate>
                                <asp:Label ID="Label4" runat="server" Text='<%# Get_peopleName(Eval("createuid")) %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="7%" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="修建時間">
                            <ItemTemplate>
                                <asp:Label ID="Label5" runat="server" Text='<%# Get_DateTime(Eval("createtime")) %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="10%" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="修改" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <a class="thickbox imageButton edit" title="修改" href='<%# Get_url(Eval("mes_no")) %>'>
                                    <span>修改</span></a>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="7%" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="刪除">
                            <ItemTemplate>
                                <asp:Button ID="button_disable" runat="server" CommandName="disable" CssClass="delete"
                                    CommandArgument="<%# Container.DataItemIndex %>" OnClientClick=" return confirm('確定要刪除?')" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="7%" />
                        </asp:TemplateField>
                    </Columns>
                </cc1:GridView>
            </div>
            <div class="pager">
                <asp:DataPager ID="DataPager1" runat="server" PagedControlID="GridView1" PageSize="25">
                    <Fields>
                        <CCH:GooglePagerField />
                    </Fields>
                </asp:DataPager>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
